package com.ele.client;

import com.ele.client.activity.auth.LoginView;
import com.ele.client.activity.auth.LoginViewImpl;
import com.ele.client.activity.auth.RegistrationView;
import com.ele.client.activity.auth.RegistrationViewImpl;
import com.ele.client.activity.editor.EditorView;
import com.ele.client.activity.editor.EditorViewImpl;
import com.ele.client.activity.home.HomeView;
import com.ele.client.activity.home.HomeViewImpl;
import com.ele.client.activity.terminal.TerminalView;
import com.ele.client.activity.terminal.TerminalViewImpl;
import com.ele.client.rpc.ApplicationService;
import com.ele.client.rpc.ApplicationServiceAsync;
import com.google.gwt.core.shared.GWT;
import com.google.gwt.place.shared.PlaceController;
import com.google.web.bindery.event.shared.EventBus;
import com.google.web.bindery.event.shared.SimpleEventBus;

public class ClientFactoryImpl implements ClientFactory {

    private final EventBus eventBus = new SimpleEventBus();
    private final PlaceController placeController = new PlaceController(eventBus);

    private final LoginView loginView = new LoginViewImpl();
    private final RegistrationView registrationView = new RegistrationViewImpl();
    private final EditorView editorView = new EditorViewImpl();
    private final HomeView homeView = new HomeViewImpl();
    private final TerminalView terminalView = new TerminalViewImpl();

    private final ApplicationServiceAsync applicationService = GWT.create(ApplicationService.class);

    @Override
    public EventBus getEventBus() {
        return eventBus;
    }

    @Override
    public PlaceController getPlaceController() {
        return placeController;
    }

    @Override
    public LoginView getLoginView() {
        return loginView;
    }

    @Override
    public RegistrationView getRegistrationView() {
        return registrationView;
    }

    @Override
    public ApplicationServiceAsync getApplicationService() {
        return applicationService;
    }

    @Override
    public EditorView getEditorView() {
        return editorView;
    }

    @Override
    public HomeView getHomeView() {
        return homeView;
    }

    @Override
    public TerminalView getTerminalView() {
        return terminalView;
    }
}
